<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>

<c:if test="${fn:length(traceResult)==0}">
  <div><i>结果:暂无相关订单信息</i></div>
</c:if>

<c:if test="${fn:length(traceResult)>0}">
  <div><i>结果:共${fn:length(traceResult)}条相关运单信息</i></div>
<div id="idSearchResultPanelGroup">
  <c:forEach var="waybillTraceResult" items="${traceResult}"  varStatus="searchResultStatus">
     <div class="row">
       <div class="panel panel-default">
         <div class="panel-heading">运单信息</div>
         <div class="panel-body">
           <table class="table">
             <tbody>
             <tr>
               <td><b>承运公司:</b></td><td>${waybillTraceResult.comName}</td><td><b>托运时间:</b></td><td><fmt:formatDate value="${waybillTraceResult.sendDate}" pattern="yyyy-MM-dd HH:mm"/> </td>
             </tr>
             <tr>
               <td><b>运单号码:</b></td><td>${waybillTraceResult.waybillNo}</td><td><b>运行区间:</b></td><td>${waybillTraceResult.startAddr}-${waybillTraceResult.endAddr}</td>
             </tr>
             </tbody>
           </table>
         </div>
       </div>
     </div>
      <div class="row">
        <table class="table table-hover">
          <thead>
          <tr>
            <th width="100px">时间</th>
            <th>路踪记录</th>
          </tr>
          </thead>
          <tbody>
          <c:forEach var="waybillTrace" items="${waybillTraceResult.traces}">
          <tr>
            <td><fmt:formatDate value="${waybillTrace.operateTime}"/></td>
            <td>${waybillTrace.remark}</td>
          </tr>
          </c:forEach>
          </tbody>
        </table>
      </div>
  </c:forEach>
</div>
<script type="application/javascript">
  //"status":1已揽件 2已收货 3待处理 4已中转 5已签收
  $(function(){
    $("#idSearchResultPanelGroup").find(".search-result-collapse-button").click(function(e){
      var w = $(this).data("my-w");
      var c = $(this).data("my-c");
      var q = $(this).data("my-q");
      $.post('${ctx}/workbench/queryHistory/log', {"c":c,"w":w,"q":q}, function(data){});
    });

  })
</script>
</c:if>




